package com.tunnel.common.tunnel;

import com.tunnel.common.task.BaseTask;

import io.netty.channel.ChannelHandlerContext;

public class TunnelData {
	private byte flag;//标识，数据类型，与TunnelDataSendUtil里的数据类型对应
	private byte[][] datas;//数据包，多个
	private BaseTask task;//数据包对应的来源任务，表示这个数据包由哪个任务产生，里面包含了任务的状态信息等
	private ChannelHandlerContext ctx;//对应的channel

	public TunnelData(ChannelHandlerContext ctx,byte flag, byte[] ...data) {
		this.ctx = ctx;
		this.flag = flag;
		this.datas = data;
	}
	
	public TunnelData(BaseTask task,ChannelHandlerContext ctx,byte flag, byte[] ...data) {
		this.ctx = ctx;
		this.task = task;
		this.flag = flag;
		this.datas = data;
	}

	public byte getFlag() {
		return flag;
	}

	public byte[][] getDatas() {
		return datas;
	}

	public BaseTask getTask() {
		return task;
	}
	
	public ChannelHandlerContext getCtx() {
		return ctx;
	}
}
